package controller;

import interfaceEntity.IErrorBtn;

import java.util.TimerTask;

import android.graphics.Color;

public class ControllerErrorBtn implements IErrorBtn 
{
	TimerTask tt;
	boolean [] errStatus;
	public ControllerErrorBtn () 
	{
		errStatus = new boolean[5];
		resetErrStatus(); 
	}
	
	//set default value(false) for all elements
	private void  resetErrStatus() 
	{
		for(int i=0; i<errStatus.length; i++)
		{
			errStatus[i]=false;
		}
	}
	
	@Override
	public int setBtnColor(int val) //return color
	{
		if(errStatus[val])
		{
			errStatus[val]=false;
			return Color.GREEN;
		}
		else
		{
			errStatus[val]=true;
			return Color.RED;
		}
	}


	@Override
	public void clearAllErrors() 
	{
		resetErrStatus();
		
	}


	@Override
	public void setError() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean[] getBtnStatus() 
	{
		// TODO Auto-generated method stub
		return errStatus;
	}


}
